package com.malie.myspringboot.developmentManual;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.malie.myspringboot.common.UserPlusEntity;
import com.malie.myspringboot.mybatis.MybatisDemoMapper;
import com.malie.myspringboot.mybatisPlus.MyBatisPlusDemoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController()
public class NPEDemo {
    @Autowired
    MyBatisPlusDemoMapper myBatisPlus;
    @Autowired
    MybatisDemoMapper mybatisDemoMapper;


    @GetMapping("/npedemo1")
    public String returnList() {
        List<UserPlusEntity> list = myBatisPlus.selectList(new QueryWrapper<UserPlusEntity>().eq("delete_flag", false));
        System.out.println(list);
        // System.out.println(list.get(0));
        if (CollectionUtils.isEmpty(list)) {
            return "kong";
        }
        return "ok";
    }
}
